package com.efast.dmom.mgmt.service.mes.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.efast.dmom.mgmt.dao.mes.TmBasTestDefinitionItemDao;
import com.efast.dmom.mgmt.entity.mes.TmBasTestDefinitionItem;
import com.efast.dmom.mgmt.service.mes.TmBasTestDefinitionItemService;
import com.efast.dmom.mgmt.utils.Assist;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class TmBasTestDefinitionItemServiceImpl implements TmBasTestDefinitionItemService{
    @Autowired
    private TmBasTestDefinitionItemDao tmBasTestDefinitionItemDao;
    @Override
    public long getTmBasTestDefinitionItemRowCount(Assist assist){
        return tmBasTestDefinitionItemDao.getTmBasTestDefinitionItemRowCount(assist);
    }
    @Override
    public List<TmBasTestDefinitionItem> selectTmBasTestDefinitionItem(Assist assist){
        return tmBasTestDefinitionItemDao.selectTmBasTestDefinitionItem(assist);
    }
    @Override
    public TmBasTestDefinitionItem selectTmBasTestDefinitionItemByObj(TmBasTestDefinitionItem obj){
        return tmBasTestDefinitionItemDao.selectTmBasTestDefinitionItemByObj(obj);
    }
    @Override
    public TmBasTestDefinitionItem selectTmBasTestDefinitionItemById(Integer id){
        return tmBasTestDefinitionItemDao.selectTmBasTestDefinitionItemById(id);
    }
    @Override
    public int insertTmBasTestDefinitionItem(TmBasTestDefinitionItem value){
        return tmBasTestDefinitionItemDao.insertTmBasTestDefinitionItem(value);
    }
    @Override
    public int insertNonEmptyTmBasTestDefinitionItem(TmBasTestDefinitionItem value){
        return tmBasTestDefinitionItemDao.insertNonEmptyTmBasTestDefinitionItem(value);
    }
    @Override
    public int insertTmBasTestDefinitionItemByBatch(List<TmBasTestDefinitionItem> value){
        return tmBasTestDefinitionItemDao.insertTmBasTestDefinitionItemByBatch(value);
    }
    @Override
    public int deleteTmBasTestDefinitionItemById(Integer id){
        return tmBasTestDefinitionItemDao.deleteTmBasTestDefinitionItemById(id);
    }
    @Override
    public int deleteTmBasTestDefinitionItem(Assist assist){
        return tmBasTestDefinitionItemDao.deleteTmBasTestDefinitionItem(assist);
    }
    @Override
    public int updateTmBasTestDefinitionItemById(TmBasTestDefinitionItem enti){
        return tmBasTestDefinitionItemDao.updateTmBasTestDefinitionItemById(enti);
    }
    @Override
    public int updateTmBasTestDefinitionItem(TmBasTestDefinitionItem value, Assist assist){
        return tmBasTestDefinitionItemDao.updateTmBasTestDefinitionItem(value,assist);
    }
    @Override
    public int updateNonEmptyTmBasTestDefinitionItemById(TmBasTestDefinitionItem enti){
        return tmBasTestDefinitionItemDao.updateNonEmptyTmBasTestDefinitionItemById(enti);
    }
    @Override
    public int updateNonEmptyTmBasTestDefinitionItem(TmBasTestDefinitionItem value, Assist assist){
        return tmBasTestDefinitionItemDao.updateNonEmptyTmBasTestDefinitionItem(value,assist);
    }

    public TmBasTestDefinitionItemDao getTmBasTestDefinitionItemDao() {
        return this.tmBasTestDefinitionItemDao;
    }

    public void setTmBasTestDefinitionItemDao(TmBasTestDefinitionItemDao tmBasTestDefinitionItemDao) {
        this.tmBasTestDefinitionItemDao = tmBasTestDefinitionItemDao;
    }
	@Override
	public Map<Integer, Object> getTestDefinitionItemByids(String defItemIds) {
		Map<Integer, Object> map = new HashMap<Integer, Object>();
		Assist assist = new Assist();
		assist.setRequires(Assist.customRequire("item_id in", "("+defItemIds+")"));
		List<TmBasTestDefinitionItem> itemList = tmBasTestDefinitionItemDao.selectTmBasTestDefinitionItem(assist);
		if(itemList!=null&&itemList.size()>0) {
			for(TmBasTestDefinitionItem i:itemList) {
				map.put(i.getItemId(), i);
			}
		}
		return map;
	}

}